Preview - Constructing A Simple Model: Solid Diffusion

Implementing the setup procedure


Here is one way to choose the agents and agent-properties and write a pseudo-code setup procedure

Agents: a-type atoms  and b-type atoms (turtles), lattice sites (patches)

Agent properties: location (atoms)

Pseudo-code setup procedure: 

  • Ask patches on the left half of the view to sprout type 1 atoms
  • Ask patches on the right half of the view to sprout type 2 atoms.

As you can see, this is quite simple. For now, we won't need any more agent properties besides the default property of location which all turtles already have in the form of an xcor and ycor. We will also use color to tell the two types of atoms apart. 



Questions

Please answer the questions below.

Implement a setup procedure in NetLogo code based on the pseudo-code. You can use the pseudo-code above, or if yours is different and you think it is better, use that. When you have it working, copy your code here. (Make sure to check out sprout command if you haven't already). It is recommended to use NetLogo Desktop for this whole lesson, because there are parts at the end which are not yet supported on NetLogo Web.


If you had any issues on this page, describe them below. If not, type something like "no problems" and continue on.


Notes

These notes will appear on every page in this lesson so feel free to put anything here you'd like to keep track of.